package entity;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * describe 项目类
 * author wencong 2022/3/3
 */
public class ProjectEntity {

    // /Users/wencong/Documents/workspace/vs-workspace/erp-asp/Controllers
    // /Users/wencong/Documents/workspace/intellij-workspace/code-generator/file

    // 获取项目对象
    public static ProjectEntity getProject(String projectName){
        return switch (projectName) {
            case "duroAdminAsp" -> new ProjectEntity("net", "duroAdminAsp", ".cs", "wencong", getCurrentDate(), "duroasp");
            case "duroErpAsp" -> new ProjectEntity("net", "duroErpAsp", ".cs", "wencong", getCurrentDate(), "duroasp");
            case "hmErpCloudAsp" -> new ProjectEntity("net", "hmErpCloudAsp", ".cs", "wencong", getCurrentDate(), "hmErpCloudAsp");
            default -> new ProjectEntity();
        };
    }

    // 获取当前日期字符串
    public static String getCurrentDate(){
        Date date = new Date();
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
        return formatter.format(date);
    }

    // 技术语言分类文件夹
    private String language;
    // 项目名
    private String projectName;
    // 项目文件后缀
    private String suffix;
    // 作者名
    private String author;
    // 日期
    private String date;
    // vm相对路径
    private String vmPath;

    public String getLanguage() {
        return language;
    }

    public void setLanguage(String language) {
        this.language = language;
    }

    public String getProjectName() {
        return projectName;
    }

    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }

    public String getSuffix() {
        return suffix;
    }

    public void setSuffix(String suffix) {
        this.suffix = suffix;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public String getVmPath() {
        return vmPath;
    }

    public void setVmPath(String vmPath) {
        this.vmPath = vmPath;
    }

    public ProjectEntity() {
    }

    public ProjectEntity(String language, String projectName, String suffix, String author, String date, String vmPath) {
        this.language = language;
        this.projectName = projectName;
        this.suffix = suffix;
        this.author = author;
        this.date = date;
        this.vmPath = vmPath;
    }
}
